﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Lesson7 : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        #region 代码控制
        Image img = this.GetComponent<Image>();
        //需要将引用的资源类型设置为(Sprite(2D and UI))
        img.sprite = Resources.Load<Sprite>("ui_TY_fanhui_01");
        (transform as RectTransform).sizeDelta = new Vector2(200, 200);
        img.raycastTarget = false;
        img.color = Color.red;
        #endregion
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
